﻿using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Linq;
using System.Web;

namespace Hisun.Controllers
{
    public class AbcFullAccountPeriod
    {
        public void FullAccountPeriodToDropdownlist(DropDownList DropDownList_Year, DropDownList DropDownList_Month, string Ap)
        {
            string My_Year = Ap.Substring(0, 4);
           // string My_Month = Ap.Substring(4, 2);

            DropDownList_Year.Items.Clear();
            for (int i = 0; i < 5; i++)
            {
              
                DropDownList_Year.Items.Add(new ListItem(My_Year+"年",My_Year));
                My_Year = (Convert.ToInt32(My_Year)-1).ToString();
            
            }

            DropDownList_Month.Items.Clear();
            for(int j = 1 ;j <= 12 ;j++)
            {
                if (j > 9)
                {
                    DropDownList_Month.Items.Add(new ListItem(j.ToString() + "月",j.ToString()));
                }
                else
                {
                    DropDownList_Month.Items.Add(new ListItem(j.ToString()+"月","0"+j.ToString()));
                }
                
            }



        
        }

        public void FullAccountPeriodToDropdownlist_Year(DropDownList DropDownList_Year, string Ap)
        {

            string My_Year = Ap.Substring(0, 4);
            // string My_Month = Ap.Substring(4, 2);

            DropDownList_Year.Items.Clear();
            for (int i = 0; i < 5; i++)
            {

                DropDownList_Year.Items.Add(new ListItem(My_Year + "年", My_Year));
                My_Year = (Convert.ToInt32(My_Year) - 1).ToString();

            }

 
        
        }
    }
}
